<?php
// $Id: page.tpl.php,v 1.18.2.1 2009/04/30 00:13:31 goba Exp $
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
	<?php print $head ?>
  <title><?php print $head_title ?></title>
  <?php print $styles ?>
<!--  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
  <script type='text/javascript'> 
  	jQuery.noConflict(); 
  </script>  -->
  <?php print $scripts ?>
  <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
</head>
<body<?php print is_body_class($sidebar); ?>>
<div id="header">
	<div class="wrap">
  	<div id="logo">
			<?php
        // Prepare header
        $site_fields = array();
        if ($site_name) {
          $site_fields[] = check_plain($site_name);
        }
        if ($site_slogan) {
          $site_fields[] = check_plain($site_slogan);
        }
        $site_title = implode(' ', $site_fields);
        if ($site_fields) {
          $site_fields[0] = '<span>'. $site_fields[0] .'</span>';
        }
        $site_html = implode(' ', $site_fields);
  
        if ($logo || $site_title) {
          print '<h1><a href="'. check_url($front_page) .'" title="'. $site_title .'">'. $site_title .'</a></h1>';
        }
      ?>
    </div><!-- #logo -->
    <div id="hdsearch">
    	<?php if ($search_box): ?><div class="block block-theme"><?php print $search_box ?></div><?php endif; ?>
    </div><!-- #hdsearch -->
    <div id="nav">
    	<?php //print theme('links', $primary_links, array('class' => 'links primary-links')) ?>
      <ul class="links">
      	<li><?php print l('Xem sản phẩm', "san-pham") ?></li>
      	<li><?php //print l('Thêm sản phẩm', "node/add/app", array('attributes' => array('class' => 'automodal'))) ?>
        	<a href="#blockappadd" class="leanModal">Thêm sản phẩm</a>
        </li>
      </ul>
    </div>
      
    <div id="userlinks">
    	<?php if (!$uid) { 
				//print l('Đăng nhập', "user/login", array('attributes' => array('class' => 'last leanModal', 'id' => 'userlogin')));
    		//print l('Đăng ký', "user/register", array('attributes' => array('class' => 'leanModal', 'id' => 'userreg')));
				?>
        <a href="#blockuserlogin" class="last leanModal">Đăng nhập</a>
        <a href="#blockuserreg" class="leanModal">Đăng ký</a>
        <?php
			} else {
				print l('Thoát', "logout", array('attributes' => array('class' => 'last')));
				print l('Tài khoản', "user/$uid");
			} ?>
    </div>
    <?php if (!$uid) { ?>
    	<div id="blockuserlogin"><?php print $bluserlogin;?></div>
    	<div id="blockuserreg"><?php print $bluserreg;?></div>
    <?php } else { ?>
    	<div id="blockappadd"><?php print $blappadd;?></div>
    <?php } ?>
  </div>
</div><!-- #header -->